import request from "@/utils/request";

export function login(params) {
    return request.post('/backend/login', params);
}

export function getBookCategory() {
    return request.get('/backend/bookCategory')
}

export function getAdminList(params) {
    return request.get('/backend/admin/list', {params})
}

export function addAdmin(params) {
    return request.post('/backend/admin/add', params)
}

export function showAdminById(id) {
    return request.get(`/backend/admin/showAdminById/${id}`)
}

export function updateAdmin(params) {
    return request.put('/backend/admin/update', params)
}

export function deleteAdmin(id) {
    return request.delete(`/backend/admin/delete/${id}`)
}


export function getAuthorLists(params) {
    return request.get('/backend/author/list', {params})
}

export function deleteAuthorById(id) {
    return request.delete(`/backend/author/delete/${id}`)
}

export function getUserLists(params) {
    return request.get('/backend/user/list', {params})
}

export function deleteUserById(id) {
    return request.delete(`/backend/user/delete/${id}`)
}

export function getBookLists(params) {
    return request.get('/backend/book/list', {params})
}

export function deleteBookById(id) {
    return request.delete(`/backend/book/delete/${id}`)
}